<template>
	<view class="">
		<view class="" :style="'height: '+statusBarHeight+'px;'"></view>
		<view class="" style="height: 248rpx;"></view>
		<view class="boxcenter">
			<view class="boxcenter_name">
				登录边缘共识
			</view>
			<view class="labeltext">
				<input type="number" v-model="mobile" @input='inputChange' placeholder="请输入手机号" maxlength="11"
					placeholder-class="phone" />
			</view>

			<view class="labeltext">
				<input v-if="!isshow" type="password" v-model="password" @input='inputChange' placeholder="请输入密码"
					placeholder-class="password" />
				<input v-else type="text" v-model="password" @input='inputChange' placeholder="请输入密码"
					placeholder-class="password" />
				<image :src="isshow?'../static/show.png':'../static/noshow.png'" mode="" @click="isshow=!isshow">
				</image>
			</view>
			<view :class="logining?'isbtn istext':'istext'" @click="logining?toLogin():''">
				立即登录
			</view>
			<view class="nologin flex-between">
				<view class="" @click="$fun.jump('/pages/register')">
					注册账号
				</view>
				<view class="" @click="$fun.jump('/pages/user/forgetpsw')">
					忘记密码
				</view>
			</view>
			<view class="" style="display: flex;justify-content: space-around;">
				<view class="agree">
					<image :src="isCh?'../static/sel.png':'../static/unsel.png'" mode="" @click="isCh=!isCh"></image>
					<view class="">
						我已阅读并同意 <span
							@click="$fun.jump('/pageB/noticeList/noticeInfo?name=用户政策&type=16')">《用户服务协议》</span>
						<span @click="$fun.jump('/pageB/noticeList/noticeInfo?name=隐私政策&type=15')">《隐私政策》</span>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusBarHeight: 0,
				logining: false,
				mobile: '',
				password: '',
				isCh: false,
				isshow: false
			}
		},
		onShow() {
			const phoneInfo = uni.getSystemInfoSync(); // 获取手机系统信息
			this.statusBarHeight = phoneInfo.statusBarHeight
		},
		methods: {
			inputChange() {
				const {
					mobile,
					password,
				} = this;
				if (mobile !== '' && password !== '') {
					this.logining = true
				} else {
					this.logining = false
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		width: 100%;
		height: 100%;
		background-image: url('../static/bg@2x.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}

	.boxcenter {
		width: 640rpx;
		height: 768rpx;
		background: #FFFFFF;
		border-radius: 40rpx;
		margin: 0 auto 0;
		padding: 100rpx 40rpx 30rpx;
		box-sizing: border-box;

		&_name {
			font-family: PingFangSC, PingFang SC;
			font-weight: bold;
			font-size: 40rpx;
			color: #19181A;
			text-align: center;
			font-style: normal;
			margin-bottom: 60rpx;
		}

		.labeltext {
			width: 560rpx;
			height: 96rpx;
			background: #F2F2F2;
			border-radius: 48rpx;
			padding-bottom: 20rpx;
			display: flex;
			align-items: center;
			padding-left: 30rpx;
			padding-top: 18rpx;
			box-sizing: border-box;
			margin-top: 30rpx;
			padding-right: 30rpx;
			justify-content: space-between;

			image {
				width: 42rpx;
				height: 34rpx;
			}

			&_code {
				font-weight: 500;
				font-size: 28rpx;
				color: #9999FF;
				line-height: 96rpx;
				font-style: normal;
				margin-right: 30rpx;
			}

			.istipcol {
				color: #999999;
			}
		}

		.phone,
		.password {
			background: #F2F2F2;
			border-radius: 48rpx;
			font-weight: 400;
			font-size: 28rpx;
			color: #999999;
			text-align: left;
			font-style: normal;
		}

		.nologin {
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #9999FF;
			text-align: center;
			font-style: normal;
			margin-top: 30rpx;
		}
	}

	.istext {
		width: 560rpx;
		height: 96rpx;
		border-radius: 48rpx;
	}

	.isbtn {
		background: $uni-color-primary;
		color: #FFFFFF;
	}

	.agree {
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #313233;
		line-height: 33rpx;
		text-align: center;
		font-style: normal;
		display: flex;
		margin-top: 62rpx;

		image {
			width: 36rpx;
			height: 36rpx;
			margin-right: 16rpx;
		}

		span {
			color: #6196FF;
		}
	}
</style>